<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"
	contentType="text/html;charset=UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ include file="/WEB-INF/view/common/taglibs.jsp"%>
<html>
<head>
<title>人员</title>
<script src="${contextPath}/scripts/jquery/jquery-1.8.3.min.js"
	type="text/javascript"></script>
<script src="${contextPath}/scripts/common.js" type="text/javascript"></script>
<script src="${contextPath}/scripts/My97DatePicker/WdatePicker.js"
	type="text/javascript"></script>
<link href="${contextPath}/styles/default.css" rel="stylesheet"
	type="text/css" />
<script type="text/javascript">
	function jumpPage(page) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/system/user/index.do?currentPage="+page;
		searchForm.submit();
	}
	function editData(id) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/system/user/toUpdate.do?currentPage=${currentPage}&us.id="+id;
		searchForm.submit();
	}
	function toImport(id) {
		var searchForm = document.searchForm;
		searchForm.action = "<s:property value='contextPath'/>/system/user/opneImport.do?currentPage=${currentPage}";
		searchForm.submit();
	}
		
	function deleteData(id) {
		if(confirm("确认要删除吗?")) {
			var searchForm = document.searchForm;
			searchForm.action = "<s:property value='contextPath'/>/system/user/delete.do?currentPage=${currentPage}&us.id="+id;
			searchForm.submit();
		}	  
	}
	
	function clear1(){
		document.getElementById("realName").value="";
		document.getElementById("post").selectedIndex=0;
	}
</script>
</head>
<body>
<div class="navigation">
	    <span>
	    <a href="javascript:window.history.forward();"><img src="${contextPath}/images/go_nav_btn.png" /></a>
	     <a href="javascript:window.history.forward();">前进</a>
	    <a href="javascript:window.location.reload();"><img src="${contextPath}/images/refresh_nav_btn.png" /></a>
	     <a href="javascript:window.location.reload();">刷新</a>
	    </span>系统管理&gt;&gt;用户管理
    </div>
	<div class="xt_main_right_center">
		<form action="index.do" name="searchForm" method="post">
			<table width="100%" border="0" cellpadding="0" cellspacing="0"
				style="border-color: #CCCCCC;">
				<tr>
					<td class="right-td-width-bg">姓名：</td>
					<td class="right-td-width-bg-left" >
					<input type="text" id="realName" name="search.realName" value="${search.realName }" class="input_readonly_98" /></td>
					<td class="right-td-width-bg">职位：</td>
					<td class="right-td-width-bg-left" >
						<s:select id="post" list="@com.jysz.certificate.persistence.enums.PostType@values()" listKey="index" theme="simple"  listValue="name" headerKey="-1" headerValue="***请选择***" name="search.post" cssClass="input"></s:select>
					</td>
				</tr>
				<tr style="background:url(${contextPath}/images/xt_main_right_dhbj.jpg) repeat-x;">
					<td colspan="4" align="right">
				    	<input type="button" class="btn_clear_form" value="" onclick="clear1()"/>
				    	<input type="submit" value="" class="btn_query"/>
			    	</td>
				</tr>
			</table>
		</form>
	</div>
	
	<br/>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
		  <tr>
		    <td height="25" align="left"><font color="#0066CC"><strong>查询结果：</strong></font></td>
		    <td height="25" align="right">
		    <jysz:permission code="SYS_USER_IMPORT">
		    	<a href="javascript:toImport()"><img src="${contextPath}/images/import.png" alt="导入用户" /></a>
		     </jysz:permission>
		    <jysz:permission code="SYS_USER_ADD">
		  	  <a href="toAdd.do"><img src="${contextPath}/images/btn_add.png" alt="新增" /></a>
		  	  </jysz:permission>
            </td>
		  </tr>
		</table>
	
	<table  width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
		<tr>
			<td class="top-td-width-bg">序号</td>
			<td class="top-td-width-bg">姓名</td>
			<td class="top-td-width-bg">性别</td>
			<td class="top-td-width-bg">岗位</td>
			<td class="top-td-width-bg">电话号码</td>
			<td class="top-td-width-bg">状态</td>
			<td class="top-td-width-bg">操作</td>
		</tr>
		<s:iterator value="page.result" status="i" id="u">
			<tr>
				<td class="down-center-td-width-bg">${i.count }</td>
				<td class="down-center-td-width-bg">${u.realName }</td>
				<td class="down-center-td-width-bg">${u.sex }</td>
				<td class="down-center-td-width-bg">
					<s:property value="post.name"/>
				</td>
				<td class="down-center-td-width-bg">
					${u.telephone }
				</td>
				<td class="down-center-td-width-bg">
					<s:if test='#u.locked=="0"'>激活</s:if><s:else>禁用</s:else>
				</td>
				<td class="down-center-td-width-bg">
				<jysz:permission code="SYS_USER_EDIT">
					<a href="javascript:editData(${u.id })" title="编辑"><img src="${contextPath}/images/edit.gif" alt="编辑" width="16" height="13" border="0" /></a>
					</jysz:permission>
				<jysz:permission code="SYS_USER_DEL">
	    			<a href="javascript:deleteData(${u.id })" title="删除"><img src="${contextPath}/images/del.gif" alt="删除" width="16" height="13" border="0" /></a>
				</jysz:permission>
				</td>
			</tr>
		</s:iterator>
		<tr>
			<td height="36" class="down-center-td-width-bg" align="right"
				colspan="8"><%@ include
					file="/WEB-INF/view/common/pagination.jsp"%>
			</td>
		</tr>
	</table>
	<br />
	<br />
	<br />
	<br />
	<br />
	<div><jsp:include page="/include/footer.inc"></jsp:include></div>
</body>
</html>